2025-02-05 11:40:49,003 - INFO - Num classes: 4
2025-02-05 11:42:25,639 - INFO - Class weights: tensor([0.3660, 6.9287, 2.1070, 1.5411], device='cuda:0')
2025-02-05 11:42:28,061 - INFO - Model architecture:
CombinedModel(
  (unet): Unet(
    (conv1): Sequential(
      (0): Conv2d(1024, 8, kernel_size=(5, 5), stride=(1, 1), padding=(5, 5))
      (1): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(8, 8, kernel_size=(5, 5), stride=(1, 1), padding=(5, 5))
      (4): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    )
    (conv2): Sequential(
      (0): Conv2d(8, 16, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2))
      (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(16, 16, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2))
      (4): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    )
    (conv3): Sequential(
      (0): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): MaxPool2d(kernel_size=3, stride=2, padding=1, dilation=1, ceil_mode=False)
    )
    (upconv3): Sequential(
      (0): Conv2d(32, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(16, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): ConvTranspose2d(16, 16, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
    )
    (upconv2): Sequential(
      (0): Conv2d(32, 8, kernel_size=(4, 4), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(8, 8, kernel_size=(4, 4), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): ConvTranspose2d(8, 8, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
    )
    (upconv1): Sequential(
      (0): Conv2d(16, 4, kernel_size=(6, 6), stride=(1, 1), padding=(1, 1))
      (1): BatchNorm2d(4, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
      (3): Conv2d(4, 4, kernel_size=(6, 6), stride=(1, 1), padding=(1, 1))
      (4): BatchNorm2d(4, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (5): ReLU()
      (6): ConvTranspose2d(4, 4, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), output_padding=(1, 1))
    )
  )
  (san): ImprovedHyperspectralLogisticRegressionModel(
    (spectral_attention): SpectralAttention(
      (fc): Sequential(
        (0): Linear(in_features=1024, out_features=64, bias=True)
        (1): ReLU(inplace=True)
        (2): Linear(in_features=64, out_features=1024, bias=True)
        (3): Sigmoid()
      )
    )
    (linear): Sequential(
      (0): LinearBlock(
        (block): Sequential(
          (0): Linear(in_features=1024, out_features=20, bias=True)
          (1): BatchNorm1d(20, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (2): LeakyReLU(negative_slope=0.1)
          (3): Dropout(p=0.0, inplace=False)
        )
      )
      (1): LinearBlock(
        (block): Sequential(
          (0): Linear(in_features=20, out_features=20, bias=True)
          (1): BatchNorm1d(20, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
          (2): LeakyReLU(negative_slope=0.1)
          (3): Dropout(p=0.0, inplace=False)
        )
      )
      (2): Linear(in_features=20, out_features=4, bias=True)
    )
    (logistic): Linear(in_features=4, out_features=4, bias=True)
  )
  (mlp): Sequential(
    (0): Linear(in_features=8, out_features=256, bias=True)
    (1): ReLU(inplace=True)
    (2): BatchNorm1d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (3): Dropout(p=0.2, inplace=False)
    (4): Linear(in_features=256, out_features=128, bias=True)
    (5): ReLU(inplace=True)
    (6): BatchNorm1d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (7): Dropout(p=0.2, inplace=False)
    (8): Linear(in_features=128, out_features=4, bias=True)
  )
)
2025-02-05 11:42:28,061 - INFO - Using cuda device
2025-02-05 11:44:57,785 - INFO - Epoch: 0/100. Training time: 101.438
2025-02-05 11:44:57,786 - INFO - Training Metrics...
2025-02-05 11:44:57,786 - INFO - {'loss': 1.1959759905224754, 'f1': 40.47131905886492, 'acc': 50.308554817275756, 'precision': 43.15749700837574, 'recall': 49.672213506230534, 'balanced acc': 49.672213506230534}
2025-02-05 11:44:57,786 - INFO - Validation Metrics... Inference time: 48.285
2025-02-05 11:44:57,786 - INFO - {'loss': 1.0463249683380127, 'f1': 65.55884342675465, 'acc': 92.4693446088795, 'precision': 61.812793379561285, 'recall': 71.6518194098809, 'balanced acc': 71.6518194098809}
2025-02-05 11:44:57,786 - INFO - ==================================================
2025-02-05 11:56:03,066 - INFO - Epoch: 5/100. Training time: 114.371
2025-02-05 11:56:03,109 - INFO - Training Metrics...
2025-02-05 11:56:03,181 - INFO - {'loss': 0.4208085536956787, 'f1': 66.76449748980195, 'acc': 74.50567552602436, 'precision': 64.20111215900243, 'recall': 86.11028043777583, 'balanced acc': 86.11028043777583}
2025-02-05 11:56:03,182 - INFO - Validation Metrics... Inference time: 10.826
2025-02-05 11:56:03,182 - INFO - {'loss': 0.6266974210739136, 'f1': 63.05127937108781, 'acc': 82.45806906272023, 'precision': 58.186666134125616, 'recall': 81.62308893887258, 'balanced acc': 81.62308893887258}
2025-02-05 11:56:03,182 - INFO - ==================================================
2025-02-05 12:07:23,096 - INFO - Epoch: 10/100. Training time: 80.239
2025-02-05 12:07:23,108 - INFO - Training Metrics...
2025-02-05 12:07:23,108 - INFO - {'loss': 0.35568230208896456, 'f1': 73.3866494584657, 'acc': 83.03562200073829, 'precision': 68.94213743013489, 'recall': 86.88769952625758, 'balanced acc': 86.88769952625758}
2025-02-05 12:07:23,108 - INFO - Validation Metrics... Inference time: 37.048
2025-02-05 12:07:23,108 - INFO - {'loss': 0.48579397797584534, 'f1': 65.99967125157838, 'acc': 87.73731501057082, 'precision': 60.54763647786028, 'recall': 79.88142734151663, 'balanced acc': 79.88142734151663}
2025-02-05 12:07:23,108 - INFO - ==================================================
2025-02-05 12:19:10,133 - INFO - Epoch: 15/100. Training time: 128.964
2025-02-05 12:19:10,153 - INFO - Training Metrics...
2025-02-05 12:19:10,153 - INFO - {'loss': 0.3383042684623173, 'f1': 75.70573981279041, 'acc': 85.8624492432632, 'precision': 72.2686478768167, 'recall': 87.80801050198916, 'balanced acc': 87.80801050198916}
2025-02-05 12:19:10,154 - INFO - Validation Metrics... Inference time: 29.725
2025-02-05 12:19:10,154 - INFO - {'loss': 0.4331013858318329, 'f1': 68.24163791449504, 'acc': 89.31236786469344, 'precision': 63.74711252042481, 'recall': 79.99496774261236, 'balanced acc': 79.99496774261236}
2025-02-05 12:19:10,154 - INFO - ==================================================
2025-02-05 12:29:53,697 - INFO - Epoch: 20/100. Training time: 87.536
2025-02-05 12:29:53,762 - INFO - Training Metrics...
2025-02-05 12:29:53,762 - INFO - {'loss': 0.35590270445460365, 'f1': 75.86228432493877, 'acc': 87.03580657069028, 'precision': 71.79604748081891, 'recall': 86.2755836391449, 'balanced acc': 86.2755836391449}
2025-02-05 12:29:53,762 - INFO - Validation Metrics... Inference time: 45.374
2025-02-05 12:29:53,763 - INFO - {'loss': 0.40504392981529236, 'f1': 69.06440519836889, 'acc': 89.97304439746298, 'precision': 64.94366395564043, 'recall': 79.96710992715731, 'balanced acc': 79.96710992715731}
2025-02-05 12:29:53,763 - INFO - ==================================================
2025-02-05 12:40:21,945 - INFO - Epoch: 25/100. Training time: 102.030
2025-02-05 12:40:21,967 - INFO - Training Metrics...
2025-02-05 12:40:21,968 - INFO - {'loss': 0.3287236179624285, 'f1': 76.97920076599, 'acc': 86.13349021779254, 'precision': 73.57121162887185, 'recall': 88.13233218852687, 'balanced acc': 88.13233218852687}
2025-02-05 12:40:21,968 - INFO - Validation Metrics... Inference time: 32.010
2025-02-05 12:40:21,968 - INFO - {'loss': 0.3902868926525116, 'f1': 69.16282761987203, 'acc': 89.77448907681466, 'precision': 65.3527332982339, 'recall': 80.1720441826639, 'balanced acc': 80.1720441826639}
2025-02-05 12:40:21,968 - INFO - ==================================================
2025-02-05 12:50:54,057 - INFO - Epoch: 30/100. Training time: 93.726
2025-02-05 12:50:54,071 - INFO - Training Metrics...
2025-02-05 12:50:54,071 - INFO - {'loss': 0.3260493122396015, 'f1': 75.19043199555585, 'acc': 87.18101698043557, 'precision': 72.27239363588657, 'recall': 86.21679558880625, 'balanced acc': 86.21679558880625}
2025-02-05 12:50:54,071 - INFO - Validation Metrics... Inference time: 29.135
2025-02-05 12:50:54,072 - INFO - {'loss': 0.374284952878952, 'f1': 69.27009602476384, 'acc': 90.58491895701198, 'precision': 65.00528250470737, 'recall': 79.4853412204678, 'balanced acc': 79.4853412204678}
2025-02-05 12:50:54,072 - INFO - ==================================================
2025-02-05 13:01:32,965 - INFO - Epoch: 35/100. Training time: 86.432
2025-02-05 13:01:32,988 - INFO - Training Metrics...
2025-02-05 13:01:32,989 - INFO - {'loss': 0.31619206354731605, 'f1': 76.62427144167711, 'acc': 86.40079365079364, 'precision': 73.33960379864082, 'recall': 87.61201767489052, 'balanced acc': 87.61201767489052}
2025-02-05 13:01:32,989 - INFO - Validation Metrics... Inference time: 33.194
2025-02-05 13:01:32,989 - INFO - {'loss': 0.3753439784049988, 'f1': 69.22002403259675, 'acc': 90.12244538407329, 'precision': 65.29869398793652, 'recall': 79.8539443880122, 'balanced acc': 79.8539443880122}
2025-02-05 13:01:32,989 - INFO - ==================================================
2025-02-05 13:11:22,094 - INFO - Epoch: 40/100. Training time: 97.443
2025-02-05 13:11:22,156 - INFO - Training Metrics...
2025-02-05 13:11:22,185 - INFO - {'loss': 0.3264621709074293, 'f1': 76.04070919475083, 'acc': 86.26130490956072, 'precision': 72.4958733905882, 'recall': 87.02420318494545, 'balanced acc': 87.02420318494545}
2025-02-05 13:11:22,185 - INFO - Validation Metrics... Inference time: 8.285
2025-02-05 13:11:22,186 - INFO - {'loss': 0.37061047554016113, 'f1': 69.2707208630489, 'acc': 90.11046511627907, 'precision': 65.44684845580518, 'recall': 79.98928379419327, 'balanced acc': 79.98928379419327}
2025-02-05 13:11:22,186 - INFO - ==================================================
2025-02-05 13:22:33,536 - INFO - Epoch: 45/100. Training time: 86.619
2025-02-05 13:22:33,599 - INFO - Training Metrics...
2025-02-05 13:22:33,599 - INFO - {'loss': 0.3129591885067168, 'f1': 76.84442167898834, 'acc': 86.92949427833148, 'precision': 73.05981355669098, 'recall': 88.1007050780714, 'balanced acc': 88.1007050780714}
2025-02-05 13:22:33,599 - INFO - Validation Metrics... Inference time: 42.049
2025-02-05 13:22:33,599 - INFO - {'loss': 0.37360259890556335, 'f1': 69.0596223445709, 'acc': 89.62015503875969, 'precision': 65.21186174427835, 'recall': 80.35988495763836, 'balanced acc': 80.35988495763836}
2025-02-05 13:22:33,600 - INFO - ==================================================
2025-02-05 13:33:48,537 - INFO - Epoch: 50/100. Training time: 111.497
2025-02-05 13:33:48,565 - INFO - Training Metrics...
2025-02-05 13:33:48,565 - INFO - {'loss': 0.3397658850465502, 'f1': 74.94344012613038, 'acc': 85.90992986341823, 'precision': 71.02039281638456, 'recall': 86.98436382538478, 'balanced acc': 86.98436382538478}
2025-02-05 13:33:48,565 - INFO - Validation Metrics... Inference time: 39.916
2025-02-05 13:33:48,566 - INFO - {'loss': 0.3750353753566742, 'f1': 69.03692512882779, 'acc': 89.53629316420015, 'precision': 65.22104509452211, 'recall': 80.48321634746465, 'balanced acc': 80.48321634746465}
2025-02-05 13:33:48,566 - INFO - ==================================================
2025-02-05 13:43:56,961 - INFO - Epoch: 55/100. Training time: 73.922
2025-02-05 13:43:56,972 - INFO - Training Metrics...
2025-02-05 13:43:56,972 - INFO - {'loss': 0.30400618343126207, 'f1': 77.74602726171325, 'acc': 87.62882982650426, 'precision': 74.40566869253645, 'recall': 87.85252504025067, 'balanced acc': 87.85252504025067}
2025-02-05 13:43:56,972 - INFO - Validation Metrics... Inference time: 40.791
2025-02-05 13:43:56,972 - INFO - {'loss': 0.36600223183631897, 'f1': 69.2567200857317, 'acc': 89.80549682875264, 'precision': 65.53034834497097, 'recall': 80.35940524240706, 'balanced acc': 80.35940524240706}
2025-02-05 13:43:56,972 - INFO - ==================================================
2025-02-05 13:43:56,972 - INFO - Early stopping criterion met. Stopping training.
2025-02-05 13:44:12,813 - INFO - Final test metrics:
{'f1': 69.48302490764733, 'acc': 90.53453136011275, 'precision': 65.56165393106231, 'recall': 79.57525786910837, 'balanced acc': 79.57525786910837}
